import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

import { resolve } from "path";

// https://vitejs.dev/config/
export default defineConfig({
	alias: {
		"@": resolve(__dirname, "src"),
		comps: resolve(__dirname, "src/components"),
		styles: resolve(__dirname, "src/styles"),
		apis: resolve(__dirname, "src/apis"),
		utils: resolve(__dirname, "src/utils"),
		views: resolve(__dirname, "src/views"),
	},
	css: {
		preprocessorOptions: {
			scss: {
				additionalData: `
					@import "./src/styles/vaiables.module";
					`,
			},
		},
	},
	server: {
		port: 8888,
		strictPort: true, //端口占用 自动替换
	},
	plugins: [vue()],
});
